package net.esj.basic.core.view.tools;

import java.util.Map;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpSession;

import net.esj.basic.core.view.tools.searcher.Searcher;
import net.esj.basic.core.view.tools.searcher.SearcherColumn;

public interface AgentContext {
	
	long getCookieMaxAge();

	ServletRequest getRequest();
	
	ServletResponse getResponse();
	
	/**
	 * 客户端情况 包括操作系统版本 浏览器版本等。。
	 * @return
	 */
	ClientAgent getClient();
	
	HttpSession getSession();
	
	/**
	 * 搜索器
	 * @return
	 */
	Searcher getSearcher(String key);
	
	void clearSearcher(String key);
	
	void clearAllSearchers();
	
	void addSearchColumn(String searcherKey,String key,String type,String view,Object value);
	
	void addSearchColumn(String searcherKey,SearcherColumn column);
	
	void addSearchOrder(String searcherKey,String key,String view,Object value,int order);
	
	void addSearchOrder(String searcherKey,SearcherColumn column,int order);
	
	void addSearchOrder(String searcherKey,String key,String view,Object value);
	
	void clearSearchOrder(String searcherKey);
	
	void addSearchOrder(String searcherKey,SearcherColumn column);
	
	void addRequestAttribute(String key,Object o);
	
	void addSessionAttribute(String key,Object o);
	
	void addCookie(Cookie cookie);
	
	void addCookie(String key, String value,boolean needEncrypt);
	
	String getCookieValue(String key,boolean needDecrypt);
}
